//
//  AppDelegate.swift
//  LLBBaseVC
//
//  Created by Yun on 11/01/2018.
//  Copyright (c) 2018 Yun. All rights reserved.
//

import UIKit
import LLBBaseVC

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?
    var tab:LLBBaseTabBarController!

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        tab = LLBBaseTabBarController()
        let nav1 = LLBBaseNavigationController(rootViewController: MainViewController())
        let nav2 = LLBBaseNavigationController(rootViewController: ListViewController())
        let nav3 = LLBBaseNavigationController(rootViewController: MyPageViewController())
        configTab(nav: nav1, title: "首页")
        configTab(nav: nav2, title: "列表")
        configTab(nav: nav3, title: "我的")
        tab.viewControllers = [nav1,nav2,nav3]
        tab.tabBar.tintColor = #colorLiteral(red: 0.9254902005, green: 0.2352941185, blue: 0.1019607857, alpha: 1)
        tab.tabBar.backgroundColor = UIColor.white
        window = UIWindow.init(frame: UIScreen.main.bounds)
        window?.rootViewController = tab
        window?.makeKeyAndVisible()
        return true
    }
    
    private func configTab(nav:LLBBaseNavigationController,title:String){
        nav.tabBarItem.title = title
        nav.tabBarItem.image = UIImage.init(named: "electric")
    }
}


